const navsView = {
    state: {
        visitedViews: [],
    },
    mutations: {
        ADD_NAVSVIEW: (state, view) => {
            if (state.visitedViews.some(v => v.path === view.path)) return
            state.visitedViews.push(
                Object.assign({}, view, {
                    title: view.title || 'no-name'
                })
            )
        }
    },
    actions: {
        addNavsView({ commit }, view) {
            commit('ADD_NAVSVIEW', view)
          }
    }

}

export default navsView